/*
 * Lenovo Group
 * Copyright (c) 2015-2016 All Rights Reserved.
 * 
 * Project Name:assign-tracer
 * Create Time: 2016年2月19日 下午9:14:23
 */
package com.lenovo.lmrp.server.assigntracer.domain.workflow;

import java.util.Date;

import javax.inject.Inject;

import com.lenovo.lmrp.api.constant.TicketStatus;
import com.lenovo.lmrp.api.model.entity.ProcessPO;
import com.lenovo.lmrp.api.model.entity.TicketPO;
import com.lenovo.lmrp.api.model.entity.TicketProcessPO;

/**
 * 
 * @author wujin
 * @version v1.0
 */
public class ProcessBO {
    private ProcessPO processPO;
    private IProcessService service;
    
    @Inject
    public ProcessBO(IProcessService service, ProcessPO processPO) {
        this.service = service;
        this.processPO = processPO;
    }
    
/*    *//**
     * Create Process instance and construct TicketProcessPO for ticket. 
     * Process should use signalStart event, because we should store ProcessInstancePO first then start to run process
     * 
     * @param ticketPO
     * @return
     *//*
    public TicketProcessPO createProcessInstance(TicketPO ticketPO) {
        TicketProcessPO tp = new TicketProcessPO();
        tp.setTicketId(ticketPO.getId());
        tp.setProcessId(processPO.getProcessId());
        tp.setItsmcode(processPO.getItsmCode());
        tp.setStartTime(new Date());
        tp.setTicketStatus(TicketStatus.get(ticketPO.getStatus()));
        tp.setInstanceId(service.createProcessInstance(processPO.getProcessId(), processPO.getItsmCode(), ticketPO));
        return tp;
    }*/
}
